#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int chu = 2;
  while (n > 1) {
    if (chu > 5) {
      cout << "Irregular Number";
      return 0;
    }
    if (n % chu == 0)
      n = n / chu;
    else
      chu++;
  }
  cout << "Regular Number";
  return 0;
}